<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <h:form id="invEgresoSearch" styleClass="edit">

        <rich:simpleTogglePanel label="Filtro de busqueda de egresos" switchType="ajax">

         
            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">Observacion:</ui:define>
                <h:inputText id="egrObservacion" value="#{invEgresoList.invEgreso.egrObservacion}"/>
            </s:decorate>

              
            <s:decorate template="layout/display.xhtml">
                <ui:define name="label">Numero de egreso</ui:define>
                <h:inputText id="ingObservacion" value="#{invEgresoList.invEgreso.buscadorEgrCodigo}"/>
            </s:decorate>

           <s:decorate template="layout/display.xhtml">
           <ui:define name="label">Cliente:</ui:define>
<h:selectOneMenu value="#{invEgresoList.invEgreso.buscadorProveedor}"
    defaultLabel="Seleccione..." 
                directInputSuggestions="true"
                enableManualInput="false" 
>

<f:selectItems value="#{grupoListado.listaBusquedaDeClienteSelectItems}"  />
</h:selectOneMenu>
</s:decorate>

        </rich:simpleTogglePanel>

        <div class="actionButtons">
            <h:commandButton id="search" value="Buscar" action="/InvEgresoList.xhtml"/>
            <s:button id="reset" value="Limpiar" includePageParams="false"/>
        </div>

    </h:form>

    <rich:panel>
        <f:facet name="header">Resultado de busqueda de egresos</f:facet>
    <div class="results" id="invEgresoList">

    <h:outputText value="No hay resultado de busqueda !!!"
               rendered="#{empty invEgresoList.resultList}"/>

    <rich:dataTable id="invEgresoList"
                var="_invEgreso"
              value="#{invEgresoList.resultList}"
           rendered="#{not empty invEgresoList.resultList}">
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{invEgresoList}"/>
                    <ui:param name="propertyLabel" value="N# Egreso"/>
                    <ui:param name="propertyPath" value="invEgreso.egrCodigo"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_invEgreso.egrCodigo}"/>
        </h:column>
       
         <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{invEgresoList}"/>
                    <ui:param name="propertyLabel" value="Fecha"/>
                    <ui:param name="propertyPath" value="invEgreso.egrFecha"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_invEgreso.egrFecha}">
                <s:convertDateTime type="date" pattern="MM/dd/yyyy"/>
            </h:outputText>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{invEgresoList}"/>
                    <ui:param name="propertyLabel" value="Cliente"/>
                    <ui:param name="propertyPath" value="invEgreso.invCliente.cliNombre"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_invEgreso.invCliente.cliNombre}"/>
        </h:column>
         <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{invEgresoList}"/>
                    <ui:param name="propertyLabel" value="Observacion"/>
                    <ui:param name="propertyPath" value="invEgreso.egrObservacion"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_invEgreso.egrObservacion}"/>
        </h:column>
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{invEgresoList}"/>
                    <ui:param name="propertyLabel" value="Descuento"/>
                    <ui:param name="propertyPath" value="invEgreso.egrDescuento"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_invEgreso.egrDescuento}">
                <f:convertNumber/>
            </h:outputText>
        </h:column>
       
        <h:column>
            <f:facet name="header">
                <ui:include src="layout/sort.xhtml">
                    <ui:param name="entityList" value="#{invEgresoList}"/>
                    <ui:param name="propertyLabel" value="Iva"/>
                    <ui:param name="propertyPath" value="invEgreso.egrIva"/>
                </ui:include>
            </f:facet>
            <h:outputText value="#{_invEgreso.egrIva}">
                <f:convertNumber/>
            </h:outputText>
        </h:column>
        
       
       
        
        <rich:column styleClass="action">
            <f:facet name="header">Acciones</f:facet>
            <s:link view="/#{empty from ? 'InvEgreso' : from}.xhtml"
                   value="#{empty from ? 'Ver' : 'Seleccionar'}"
             propagation="#{empty from ? 'none' : 'default'}"
                      id="invEgreso">
                <f:param name="invEgresoEgrCodigo"
                        value="#{_invEgreso.egrCodigo}"/>
            </s:link>
            #{' '}
            
        </rich:column>
    </rich:dataTable>

    </div>
    </rich:panel>

    <div class="tableControl">

        <s:link view="/InvEgresoList.xhtml"
            rendered="#{invEgresoList.previousExists}"
               value="#{messages.left}#{messages.left} First Page"
                  id="firstPage">
          <f:param name="firstResult" value="0"/>
        </s:link>

        <s:link view="/InvEgresoList.xhtml"
            rendered="#{invEgresoList.previousExists}"
               value="#{messages.left} Previous Page"
                  id="previousPage">
            <f:param name="firstResult"
                    value="#{invEgresoList.previousFirstResult}"/>
        </s:link>

        <s:link view="/InvEgresoList.xhtml"
            rendered="#{invEgresoList.nextExists}"
               value="Next Page #{messages.right}"
                  id="nextPage">
            <f:param name="firstResult"
                    value="#{invEgresoList.nextFirstResult}"/>
        </s:link>

        <s:link view="/InvEgresoList.xhtml"
            rendered="#{invEgresoList.nextExists}"
               value="Last Page #{messages.right}#{messages.right}"
                  id="lastPage">
            <f:param name="firstResult"
                    value="#{invEgresoList.lastFirstResult}"/>
        </s:link>

    </div>

    <s:div styleClass="actionButtons" rendered="#{empty from}">
        <s:button view="/InvEgresoEdit.xhtml"
                    id="create"
           propagation="none"
                 value="Crear egreso">
            <f:param name="invEgresoEgrCodigo"/>
        </s:button>
    </s:div>
    

</ui:define>

</ui:composition>
